<?php

/**************************************************************************
* Source File	:  Facade2.php
* Author                   :  amo
* Project name         :  Non enregistr�* Created                 :  12/05/2010
* Modified   	:  12/05/2010
* Description	:  Definition of the class Facade2
**************************************************************************/

include("FabriqueMySQL.php");

class Facade2 			
{
	private $fab;
	
	public function __construct() {
		
		$this->fab = FabriqueMySQL::getInstance();
	}
	//Attributes
	
	 
	
	
	//Operations
	 	
	 public function getListeComposante (){
		$liste = $this->fab->getListeComposante();
		return $liste;
	}
	public function creerComposante ($nom, $description, $rue, $ville, $cp){
		$composante = $this->fab->creerComposante ($nom, $description, $rue, $ville, $cp);
		return $composante;
	}	
	
	public function modifierComposante ($composante, $nom, $description, $rue, $ville, $cp){
		$composante->setNom($nom);
		$composante->setDescription($description);
		$composante->setAdresseRue($rue);
		$composante->setAdresseVille($ville);
		$composante->setAdresseCp($cp);
		$composante->save();
	}
	
	public function effacerComposante($composante) {
		$composante->delete();
	}
	
	public function modifierFormation($formation,$nom,$description,$duree) {
		$formation->setNom($nom);
		$formation->setDescription($description);
		$formation->setDureeFormation($duree);
		$formation->save();
	}
	
	public function effacerFormation($formation) {
		$formation->delete();
	}
	
	public function rechargerListeFormation($composante) {
		$composante->reloadFormations();
	}

} // End Class Facade2


?>

